package com.jky.stmall.exercise;

public class SingleTon {
    private SingleTon(){};
    private volatile static SingleTon s;
    public  static SingleTon newInstance(){
        if (s==null){
            synchronized (SingleTon.class){
                if (s==null){
                    s=new SingleTon();//指令重排
                }
            }
        }
        return s;
    }
}
